{include file="public/header" /}
<body class="gray-bg">
<div class="wrapper wrapper-content">
    <div class="row">
        <div class="col-sm-12">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <h5>确认收货</h5>
                </div>
                <div class="ibox-content layui-form">
                    <div class="layui-row layui-col-space10 layui-form-item ">

                        <div class="layui-form-item layui-col-md-offset1 layui-col-md8">
                            <label class="layui-form-label">订单状态：</label>
                            <div class="layui-input-block">
                                {if $after_status == 2}
                                <input type="text" name="" value="未发货" class="layui-input" disabled>
                                {/if}
                                {if $after_status == 3}
                                <input type="text" name="" value="待收货" class="layui-input" disabled>
                                {/if}
                                {if $after_status == 4}
                                <input type="text" name="" value="已收货" class="layui-input" disabled>
                                {/if}
                            </div>
                        </div>

                        <div class="layui-form-item layui-col-md-offset1 layui-col-md8 form-group">
                            <label class="layui-form-label">是否需要回寄：</label>
                            <div class="layui-input-block">
                                <select name="oi_is_rerturn" class="oi_is_rerturn" lay-filter="role">
                                    <option value="1" selected>需要</option>
                                    <option value="2" >不需要</option>
                                </select>
                            </div>
                        </div>
                        <input type="hidden" value="{$oi_id}" name="oi_id">
                        <div class="layui-form-item layui-col-md-offset1 layui-col-md8">
                            <div class="layui-input-block">
                                <button class="layui-btn" lay-submit="" lay-filter="component-form-element">确定
                                </button>
                                <button class="layui-btn layui-btn-primary" onclick="history.go(-1)">关闭</button>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
{include file="public/footer" /}
<script>
    layui.use(['form','upload','layedit','laydate'], function() {
        var form = layui.form;
        form.on('submit(component-form-element)', function (data) {

            $('.layui-btn').addClass('layui-disabled').attr('disabled','disabled');
            $.ajax({
                url:"{:url('confirmAfter')}",
                type:'post',
                dataType:'json',
                data:data.field,
                success:function(res){
                    if (res.code == 200) {
                        wk.success(res.msg,"{:url('Aftersale/checkIndex')}")
                    } else {
                        wk.error(res.msg,'','$(".layui-btn").removeClass(\'layui-disabled\').removeAttr(\'disabled\');');
                    }
                }
            })
        });
    });
</script>

</body>
</html>
